package sistkaraoke.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConexionBD {
	
	public static Connection obtenerConexion() throws SQLException {
		Connection con = null;
		
		try {
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
			
			//String connectionUrl = "jdbc:sqlserver://D17-018;" +
				//	   "databaseName=jmallqui_karaoke_final;user=sa;password=upc123;";			 			
			
			String connectionUrl = "jdbc:sqlserver://localhost;databaseName=jmallqui_Karaoke;user=sa;password=upc123;";
			
			con = DriverManager.getConnection(connectionUrl);			
			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return con;
	}	
	
}
